package com.bestcem.xm.ticket.controller.param;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 分页参数
 *
 * @author zq.ding <zq.ding@idiaoyan.com>
 * @version v1.0
 * @date 2021/8/18 21:31
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class PageParam {
    /**
     * 页号
     */
    @NotNull(message = "页号不能为空")
    @Min(value = 1, message = "页号不能小于1")
    private Integer page;

    /**
     * 分页大小
     */
    @JsonProperty("rowsPerPage")
    @NotNull(message = "每页大小不能为空")
    @Min(value = 1, message = "每页大小不能小于1")
    @Max(value = 1000, message = "每页大小不能大于1000")
    private Integer size;
}